  
 function validateComments(input) {
	if(input.type=="text"){//判断是否为学号框
		if(input.value.length==0){
			input.setCustomValidity("请输入学号");
		}else if(input.value.length>0){
			input.setCustomValidity("");
		
		/*
			//没有错误。清除任何错误消息
			input.setCustomValidity("");
			var re = new RegExp("^[0-9]*[1-9][0-9]*$");
			if (input.value != "") {
				if (!re.test(input.value)) {
					input.setCustomValidity("请输入数字");
					input.value = "";
					input.focus();
				}
			}
		*/
		}
	}else if(input.type=="password"){//判断是否为密码框
		if(input.value.length==0){
			input.setCustomValidity("请输入密码");
		}else{
			//没有错误。清除任何错误消息
			input.setCustomValidity("");
		}
	}
}

function show_content(content,type) {
    toastr.options = {
        closeButton: false,
        debug: false,
        progressBar: false,
        positionClass: "toast-top-center",
        onclick: null,
        showDuration: "300",
        hideDuration: "1000",
        // timeOut: "1000",  
        extendedTimeOut: "1000",
        showEasing: "swing",
        hideEasing: "linear",
        showMethod: "fadeIn",
        hideMethod: "fadeOut"
    };
    if (content == null) {
        content = '';
    }
    var len = content.length;
    if (len <= 10 && len > 0) {
        toastr.options.timeOut = "1800";
    } else if (len <= 20) {
        toastr.options.timeOut = "2800";
    } else if (len <= 30) {
        toastr.options.timeOut = "3800";
    } else if (len > 30) {
        toastr.options.timeOut = "4800";
    }

    if(type=="alert"){
    	toastr.error("请补全您的信息");
    }else{
    	toastr.success(content);
    }
    
}


function check(){
	var name = $("#name").val();
	if(name.length==0){
		show_content("请补全您的信息","alert");
		return;
	}
	var array =  ['!','@','#','$','%','^','&','*','(',')','_','=','+','-','/'];

	for(var i = 0;i<array.length;i++){
		for(var j = 0;j<name.length;j++){
			if(array[i]==name[j]){
				show_content("名字含有非法信息","alert");
				return;
			}
		}
	}
	show_content("登录中...","success");
	$("#form").submit();
	
}







